<?php
header("Content-type:image/jpeg");
//绘制画布
$img =imagecreatetruecolor(400,400);
//定义颜色 
$white=imageColorAllocate($img,255,255,255);
$blue=imageColorAllocate($img,0,0,255);
$red=imageColorAllocate($img,255,0,0);

//填充画布
imagefill($img, 0, 0, $white);
for($i=0;$i<50;$i++)
{
	$color = imageColorAllocate($img,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255));
	
	imageline($img, mt_rand(0,400), mt_rand(0,400), mt_rand(0,400), mt_rand(0,400), $color);
}

imagepng($img);